#include <iostream>
#include <regex>
#include <string>

using namespace std;



int main()
{
    string str = "/home/1234";
    regex e("/home/(\\d+)");
    smatch match ; 
    regex_match(str , match , e);
    for(auto& x : match)
    {
        cout << x << endl;
    }


    return 0;
}